<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <%@include file="/common/common.jspf" %>
    <script type="text/javascript" src="${ctx}/js/system/user/edit.js">
    </script>
    <style type="text/css">
        .col-sm-3 {
            width: 15%;
            float: left;
        }

        .col-sm-9 {
            width: 35%;
            float: left;
        }
        label[class^="btn btn-default"]{
            margin-top: -4px;
        }
    </style>
</head>
<body>
<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
<form id="form" name="form" class="form-horizontal" method="post"
      action="${ctx}/devicemaintain/maintain_verifyUp.shtml">
    <input type="hidden" value="${user.deviceMaintainId}" name="deviceMaintainId">

    <section class="panel panel-default">
        <div class="panel-body">
            <div class="form-group">
                <label class="col-sm-3 control-label">设备维修编号</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control " name="deviceMaintainFormMap.devicemaintaincode" id="devicemaintaincode" value="${user.devicemaintaincode}" readonly = readonly >
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">设备名称</label>
                    <div class="col-sm-9">
                        <select class="form-control" name="deviceMaintainFormMap.deviceFaultId" id="deviceFaultId" readonly="readonly">
                            <option value="0">--请选择--</option>
                            <c:forEach  items="${device}" var="device">
                                <c:if test="${device.deviceCode == user.deviceFaultId}">
                                    <option value="${device.deviceCode}" selected = "selected">${device.deviceName}</option>
                                </c:if>
                            </c:forEach>
                        </select>
                    </div>
                </div>

            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-3 control-label" disabled="disabled">设备位置</label>
                <div class="col-sm-9">
                    <input type="text" class="form-control checkName" disabled="disabled" value="${user.deviceMaintainLocation}"  name="deviceMaintainFormMap.deviceMaintainLocation" id="deviceMaintainLocation">
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">设备型号</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" readonly = readonly
                               name="deviceMaintainFormMap.deviceMaintainType" id="deviceMaintainType" value="${user.deviceMaintainType}">
                    </div>
                </div>
            </div>

            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <div class="form-group">
                    <label class="col-sm-3 control-label">维修情况</label>
                    <div class="col-sm-9">
                        <select class="form-control" name="deviceMaintainstate" id="deviceMaintainstate" >
                            <option value="1">维修完成</option>
                            <option value="2">不可维修</option>
                            <option value="3">维修失败</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">报修时间</label>
                        <div class="col-sm-9">
                            <input type="date" class="form-control " readonly="readonly"
                                   name="deviceMaintainFormMap.deviceMaintainDate" id="deviceMaintainDate" value="${user.deviceMaintainDate}">
                        </div>
                    </div>

                </div>

            </div>
            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-3 control-label">故障原因</label>
                <div class="col-sm-9">
                    <textarea readonly="readonly" name="deviceMaintainFormMap.deviceMaintainCause" id="deviceMaintainCause" style="width: 628px; height: 130px;" >${user.deviceMaintainCause}</textarea>
                </div>

            </div>

            <div class="line line-dashed line-lg pull-in"></div>
            <div class="form-group">
                <label class="col-sm-3 control-label">故障处理</label>
                <div class="col-sm-9">
                    <textarea name="deviceMaintainResult" id="deviceMaintainResult" style="width: 628px; height: 130px;" >${user.deviceMaintainResult}</textarea>
                </div>

            </div>

        </div>
        <footer class="panel-footer text-right bg-light lter">
            <button type="submit" class="btn btn-success btn-s-xs">提交</button>
        </footer>
    </section>
</form>
<script type="text/javascript">
    $("#deviceFaultId").change(function(e){
        var options = $("#deviceFaultId option:selected");//获取选中数据
        $.ajax({
            url: "/MES/devicemaintain/getType.shtml",
            data: {id: options.val()},
            type: "GET",
            dataType: "json",
            success: function(data) {
                $("#deviceMaintainType").val(data)
            }
        });
    })
</script>
</body>
</html>